﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSW.Security
{
    /// <summary>
    /// Security_User
    /// </summary>
    public partial class Security_User : ISecurity_User
    {
        private Property<string> m_UserID;
        private Property<string> m_FirstName;
        private Property<string> m_LastName;
        private Property<bool> m_IsAppSupport;

        /// <summary>
        /// Called at the end of the constructor.
        /// </summary>
        protected override void base_OnCreated()
        {
            m_UserID = new Property<string>(this, "UserID");
            m_FirstName = new Property<string>(this, "FirstName");
            m_LastName = new Property<string>(this, "LastName");
            m_IsAppSupport = new Property<bool>(this, "IsAppSupport");

            AddRequiredField(m_UserID, "User ID is required.");
            AddRequiredField(m_FirstName, "First name is required.");
            AddRequiredField(m_LastName, "Last name is required.");
        }

        private void GeneratedOnUserIDChanging(string value)
        {
            m_UserID.CheckEdittable();
        }

        private void GeneratedOnFirstNameChanging(string value)
        {
            m_FirstName.CheckEdittable();
        }

        private void GeneratedOnLastNameChanging(string value)
        {
            m_LastName.CheckEdittable();
        }

        private void GeneratedOnIsAppSupportChanging(bool value)
        {
            m_IsAppSupport.CheckEdittable();
        }
    }
}
